$( document ).on( "pageshow", "#myIntegral", function( event ) {
	
});

$( document ).on( "pagecreate", "#myIntegral", function( event ) {
	hideWXToolBar();
	access_token=getQueryString("access_token");
	$.ajax({
	  	url: rootPath+"/user/personInfo.do",
	  	type: "POST",
	  	dataType: "text",
		data: "access_token="+access_token,
	  	success: function( response ) {
	  		var data=$.parseJSON(response);
	  		
			if(data.state=="200"){
		  		var user=data.data;
		  		$("#userName_myIntegral").text(user.empName);
		  		$("#userGrade_myIntegral").text(user.integralGrade);
		  		$("#userIntegralNum_myIntegral").text(user.integralNum);
		  		
		  		var userHeadPic=user.headImageUrl==undefined||user.headImageUrl==null? rootPath+defaultHeadPic :user.headImageUrl;
		  		
		  		$("#userHead_myIntegral").attr("src",userHeadPic).show();
		  		$("#userIntegralPic_myIntegral").attr("src",rootPath+user.inteGraPic);
		  		
		  		//添加链接 去看看
		  		$( "#to_look_myIntegral" ).on("click",function (){
		  			goTo(rootPath+"/jsp/weixin/gameHall.jsp?access_token="+access_token);
		  		});		  		
			}else{
				alert_wx('fail',data.msg);
			}
	  	}
	});
	//点击积分详情
	$( document ).on( "click", "#integralDetail", function( event ) {
		goTo(rootPath+"/jsp/weixin/myIntegralInfo.jsp?access_token="+access_token);
	});
	//点击积分规则
	$( document ).on( "click", "#integral_rule", function( event ) {
		goTo(rootPath+"/jsp/weixin/integral_rule.jsp?access_token="+access_token);
	});

});